<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
    <title>随手快递</title>
    <link rel="stylesheet" type="text/css" href="../../AUI/css/aui.css" />
    <link rel="stylesheet" href="http://cache.amap.com/lbs/static/main1119.css"/>
    <script type="text/javascript" src="../../AUI/script/api.js" ></script>
    <script src="../../myJs/jquery.js"></script>
    <script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=a37424dd342449fb8ab5f809081e01ce&plugin=AMap.Geocoder"></script>
    <script type="text/javascript" src="http://cache.amap.com/lbs/static/addToolbar.js"></script>
</head>
<body onload="regeocoder()">
<header class="aui-bar aui-bar-nav" style="background: #fff;height: 56px">
    <a class="aui-btn aui-pull-right" tapmode onclick="history.back();">
        <span class="aui-iconfont aui-icon-down" style="color: #515151"></span>
    </a>
</header>
<div id="container"></div>
<div id="tip" style="z-index: 100;top:0;line-height: 23px;font-size: 13px;width: 90%;left: 0;border: 0;padding: 5px 10px">
    <span id="result"></span>
</div>
<script type="text/javascript">
    var storeLongitude,storeLatitude,lnglatXY;
    $(function(){
        storeLongitude = sessionStorage.getItem("storeLongitude");
        storeLatitude = sessionStorage.getItem("storeLatitude");
        lnglatXY = [storeLongitude, storeLatitude];
    })
    //alert(lnglatXY);
    var map = new AMap.Map("container", {
                resizeEnable: true,
                zoom: 18
            });
             //已知点坐标
    function regeocoder() {  //逆地理编码
        var geocoder = new AMap.Geocoder({
            radius: 1000,
            extensions: "all"
        });
        geocoder.getAddress(lnglatXY, function(status, result) {
            if (status === 'complete' && result.info === 'OK') {
                geocoder_CallBack(result);
            }
        });
        var marker = new AMap.Marker({  //加点
            map: map,
            position: lnglatXY
        });
        map.setFitView();
    }
    function geocoder_CallBack(data) {
        var address = data.regeocode.formattedAddress; //返回地址描述
        document.getElementById("result").innerHTML = address;
    }
</script>
</body>
</html>